﻿using System.Collections.Generic;
using System.Linq;
using Model;

namespace DAL
{
    public class Universitys
    {
        public static IList<University> Select()
        {
            var universitys = from m in DbHelper.Db.University
                           select m;
            return universitys.ToList();
        }

        public static University Select(string code)
        {
            var universitys = from m in DbHelper.Db.University
                select m;
            foreach (var item in universitys)
            {
                if (item.Code == code)
                    return item;
            }
            return null;
        }
        
    }
}
